var patientId=url("?patientId")
var myCalendar = new SimpleCalendar('#calendar');
myCalendar.updateSize('100%', $('#calendar').height($('#calendar').width()));
console.log('1',$('.sc-today').width(),$('.sc-today').width()-1)
//$('.sc-today').height($('.sc-today').width())
//$('.sc-today').css({'height':$('.sc-today').width()+'px'})
$('#calendar').height($('#calendar').width())
if(selectMonth.value < 10) {
	startDate = selectYear.value + '-0' + selectMonth.value + '-01'
	endDate = selectYear.value + '-0' + selectMonth.value + '-' + searchdays[selectMonth.value]
} else {
	startDate = selectYear.value + '-' + selectMonth.value + '-01'
	endDate = selectYear.value + '-' + selectMonth.value + '-' + searchdays[selectMonth.value]
}
Achieve({
	"patientId": patientId || 10000039,
	"startDate": startDate,
	"endDate": endDate
})

//获取分数
function Achieve(param){
	$.ajax({
		type:AJAXTYPE,
		url:AJAXURL+"/achievement/list",
		data:JSON.stringify(param),
		dataType: AJAXDATATYPE,
		contentType:AJAXCONTENTTYPE,
		beforeSend: function(){
        },
        success:function(data){
//      		console.log(data.result)
//			console.log(data.result.recordList.length)
        		if(data.success==true){
        			if(data.result.recordList.length!=0){
        				$.each(data.result.recordList,function(i,v){
	        				if(v.date.substring(5,6)==0){
	        					v.date = v.date.substring(0,5)+v.date.substring(6,v.date.length)
//	        					console.log(v.date,v.value)
	        				}
						myCalendar.addMark(v.date,v.value)
	        			})

	        		}else{
        				myCalendar.updateSize('100%', $('#calendar').height($('#calendar').width()));
        			}
	        		$('.achieve_top_center_score').text(data.result.summary)        			
	        		$('.achieve_info').text(data.result.notice)

        		}
        		
        },
        error:function(){
        		console.log('error')
        }
	});
}
